saga2edit manual: Maps

Maps

Saga2edit displays a list of all available maps on the left side of the main window. The main window displays the tile map editor for the currently selected map. Additional map properties are accessed through the Map > Map Properties menu.

Maps are referenced in the game data and save data by address. Therefore, there is no index limit on the number of maps, but changes that affect map header sizes can break save data. There is still a limited amount of storage in the map header section, so saga2edit tracks the amount of free space remaining in this region. This information is displayed at the bottom of the map properties window.

Currently, map numbers are assigned sequentially based on the order maps appear in memory. If a map is deleted, then later maps will be renumbered (although renumbering will only happen the next time saga2edit opens the file).

Properties

Tile Map

The 64 by 64 tile map each map uses is independent of the map. It is possible for multiple maps to share the same tile map. For example, many Pillar of Sky maps share the same tile map, and the ending sequence contains alternate versions of many maps that share tile maps with maps from the main part of the game.

Trigger Tile Count

The trigger tile count controls how many tiles in the tile set are treated as trigger tiles. (Triggers can also be defined in the tile set regardless of this setting.)

Animation Speed

Animation speed controls the kind of tile animation that is used. Speed 0 is a special mode that works by swapping lines between the last two tile set tiles. This is used, for example, to animate the monitors in Asura's Base, and the walls in Ki's Body; and, cleverly, to create the scrolling floor illusion in the True Eye Cave.

Otherwise, only the last tile of the tile set is animated with the more familiar line by line scrolling effect (e.g. used for water, clouds, and sandstorms). Higher speed animation will scroll more pixels per frame.

Dangerous

The dangerous flag enables random encounters on the map. This also increases the size of the map header by two bytes.

Encounter Set

This can only be used if the dangerous flag is enabled. This controls which encounter set is used for random encounters.

Encounter Rate

This can only be used if the dangerous flag is enabled. Encounter rate is the probability out of 256 for a random encounter on each step. (If the rate is zero, there will be no encounters, although the random encounter PRNG will be advanced if the dangerous flag is on.)

Triggers

Trigger tiles are tiles that execute commands when the player steps on them. (Note that player input actions can take precedence over script command triggers; there is a one frame window to perform actions before the trigger activates, but the input can be buffered.)

Certain tiles in the tile set are treated as triggers based on the tile set settings and the map's trigger tile count property.

Starting with tile set tile 3 (counting from 0), a number of tiles equal to the map's trigger tile count property are trigger tiles. (This supercedes whatever setting is in the tile set.) The trigger indices of these tiles are assigned starting from 0 based on the order the tiles appear in the map. The map is scanned from top to bottom, and from left to right within each row. (This means if the same tile set tile is used more than once in the same tile map, it will still be associated with a different trigger index each time.) (This method of assigning indices is the reason, for example, why Asura's Base is moved instead of removed when it is destroyed.)

Tile set tiles that are set as triggers also count as triggers. The trigger index of these tiles is defined in the tile set.

Saga2edit highlights trigger tiles in green. In the map editor, the clicking on a trigger tile with the trigger tool active will open the trigger editor to the corresponding trigger index.

Each map can have a maximum of 32 trigger indices. Each trigger index takes two bytes in the map header. Each trigger index gets assigned to a command.

NPC GFX

There are 8 NPC GFX slots. Slot 0 is automatically loaded with the player character's data. Slot 7 is automatically loaded with the sprite sheet that has the chest sprites, the pointer, and an empty tile. The remaining 6 slots can be defined by the map header. Note that vehicles automatically use slot 1.

Each additional NPC GFX slot that is defined takes one byte in the map header. (But, there is no difference between defining 5 and 6 slots because the terminator byte can be omitted when defining 6 slots.)

NPCs

Each map can have up to 16 NPCs loaded at a time. If there are more than 16 NPCs that would be loaded, only the first 16 are loaded. Vehicles also take up an NPC slot. It can still make sense to define more that 16 NPCs for a map because they might not all be loaded at the same time. Each NPC takes six bytes in the map header.

(Also note that there is a hardware limit on the GameBoy to how many sprites can be displayed on the same line; the game does nothing to mitigate this limiation.)

Type

Chest NPCs are only designed to be used as actual chests, and normal NPCs should generally be used for everything else. Chest NPCs are controlled by a chest flag instead of by script variables. Note that the commands that directly give items or magi expect to be used with chest NPCs.

Flag

This setting is only valid for chest NPCs. This determines which chest flag controls the appearance of this NPC. This flag will also be set automatically when an NPC directly uses an item or magi command (even if the NPC is not a chest NPC, although this case should be avoided). Note that this condition is only checked each time the player enters the map or when NPC's are refreshed by a script.

Var, Min, Max

These settings control the appearance condition for normal type NPCs. The game will test whether the indicated script variable is between the specified minimum and maximum (inclusive). For NPCs that always appear, it is standard to test whether script variable 0 is between 0 and 15. Note that script variables can only takes values from 0 to 15. Also note that this condition is only checked each time the player enters the map or when NPC's are refreshed by a script.

Bump

If the bump flag is set, the player will automatically interact with the NPC when trying to walk into them without having to press the button. (For example, shops use this setting.)

X, Y

These control the initial position of the NPC on the map. Note that coordinates are counted from (0, 0) in the upper left corner of the map. The tile map editor can be used to judge the position of NPCs. NPCs are highlighted in blue.

Facing

This controls the initial direction that the NPC faces. (Note that this is naturally also controls which frame is used for NPCs with type 3 animation.

Sprite

The NPC will use the indicated NPC GFX slot. Note that slot 7 is automatically loaded with chest graphics and an empty frame, so it can always be used for those purposes. Also, slot 0 is automatically loaded with the player's graphics. Be careful when using slot 0, because you may not be able to match the graphics with the proper animation type.

Anim

The game supports four different kinds of NPC animation. Animation type 3 is the simplest. This animation type prevents the sprite from animating, and also prevents it from changing its facing. The facing setting can then be used to select one of four independent sprites. For the other animation types, east and west facing frames work the same: there are two indepedent sprites, and east and west are mirrored.

The animations types differ in the way they handle north and south frames. Type 0 animates these frame by mirroring the whole sprite. (This is the classical style of animation used in the original Final Fantasy Legend game.) Type 1 defines two 8 by 16 frames that are mirrored out to 16 by 16. (For example, this is used to create the symmetrical animation of the butterfly sprite.) Type 2 is similar to type 0, but only the bottom half of the sprite is mirrored. This allows the hands and feet to animate indepently of the upper body which can be asymmetrical.

The game has some data associating sprites with animation types that is used to ensure monsters in the player's party use the correct animation type, but this data is not available to the NPC system. Use the preview to judge the correct animation type if you are unsure.

Command

The command control what happens when the player interacts with the NPCs. For NPCs that do nothing, it is conventional to assign them to script 0. (Note that it is possible to change script 0 so that it does something, but doing that will break this convention.)

Wandering

NPCs with the wandering flag set will randomly move around. Note that NPCs will not move onto trigger tiles.